home *** CD-ROM | disk | FTP | other *** search
- unit dd3start;
-
- (* Start Up Routines
- 1) Read GAME.CTL File
- 2) Read Drop File
- 3) Initialize CommPorts
- 4) Check for Any Errors
- 5)*Initialize Script Interpretor (Coming)
- *)
-
- interface
-
- uses dd3res,dd3str,dd3graph,dd3comm,crt,dd3ini,dd3drop;
-
-
- procedure initdoordriver(filen : string);
- procedure checkparameters;
- procedure local_login;
- procedure readdropfiles;
- implementation
-
- uses dd3;
-
- procedure local_login;
- var
- a,b: integer;
- d: boolean;
- s: string;
- begin;
- clrscr;
- writeln;
- writeln('┌───────────────────────────────┐');
- writeln('│ Local Logon │');
- writeln('└───────────────────────────────┘');
- writeln;
- writeln('Please enter your name below (or leave blank for '+sysop_first_name+' '+sysop_last_name+'):');
- write('>');
- readln(s);
- if s= '' then begin;
- user_first_name:=sysop_first_name;
- user_last_name:=sysop_last_name;
- end else begin;
- user_first_name:=copy(s,1,pos(' ',s)-1);
- user_last_name:=copy(s,pos(' ',s)+1,length(s));
- end;
- graphics:=ANSI;
- bbs_time_left:=120;
- user_access_level:=255;
- end;
- procedure showparameters;
- begin
- writeln(programname+' Command Line Parameters');
- writeln('');
- writeln('');
- writeln('/A {Force ANSI Graphics Local Only}');
- writeln('/R {Force RIP Graphics Local Only}');
- writeln('/M {Force MAX Graphics Local Only}');
- writeln('/B<Lockedbaud> {Set the Locked BaudRate}');
- writeln('/C<comport> {Set the ComPort}');
- writeln('/I<irq> {Set the IRQ}');
- writeln('/F {Set Comm Routines to Fossil}');
- writeln('/D<BBSType> {Taken From DROPFILE.INI Headers}');
- writeln('/L {Set to Local Login - Will Use DropFile if Found}');
- writeln('/N<Node> {Set the Node Number} ');
- writeln('/P<DropFile> {Set the DropFile Path}');
- writeln('/K<CTLFile> {Set the Control File}');
- writeln('/? {Show this Screen}');
- halt;
- end;
-
- procedure checkparameters;
- var i : byte;
- temp : string;
- begin
- for i := 1 to paramcount do
- begin
- temp := paramstr(i);
- case upcase(temp[2]) of
- 'B' : lockedbaud := str_to_int(copy(temp,3,length(temp)));
- 'C' : com_port := str_to_int(copy(temp,3,length(temp)));
- 'I' : nonsirq := str_to_int(copy(temp,3,length(temp)));
- 'F' : asynctype := fossil;
- 'L' : local := true;
- 'N' : node_num := str_to_int(copy(temp,3,length(temp)));
- 'R' : graphics := RIP;
- 'M' : graphics := MAX;
- 'P' : dropfilepath := copy(temp,3,length(temp));
- 'D' : bbstype := copy(temp,3,length(temp));
- 'K' : ctlfile := copy(temp,3,length(temp));
- '?' : showparameters;
- end;{Case}
- end;{for}
-
- if ctlfile = '' then ctlfile := 'DOOR.CTL';
- if node_num = 0 then node_num := 1;
- end;
-
- procedure initdoordriver(filen:string);
- begin
- readall(filen);
- dropfilepath := resourcestring('DropFile',DropFilepath);
- lockedbaud := resourceinteger('LockedBaud',lockedbaud);
- sysop_first_name := resourcestring('SysopFirst','Joe');
- sysop_last_name := resourcestring('SysopLast','Sysop');
- BBSType := resourcestring('BBSType',BBSType);
- Com_port := resourceinteger('ComPort',com_port);
- UseFossil := resourceboolean('Fossil',false);
- NonSport := resourcestring('Port','0');
- NonSIRQ := resourceinteger('Irq',nonsirq);
- MaxTime := resourceinteger('MaxTime',0);
- board_name := resourcestring('BBSName','Joes BBS!');
- if usefossil then
- asynctype := fossil;
- end;
-
- procedure readdropfiles;
- var
- temp : string;
- ansic : boolean;
- begin
- if BBSType = '' then BBSType := 'DOORSYS';
- loadini('GDROP.INI');
- ReadDrop(DropFilePath+getentry(BBSType,'DosName','DOOR.SYS'));
- user_first_name := dropstring(getentryi(BBSType,'FirstName',0));
- if getentryi(BBSType,'FirstName',0) = getentryi(BBSType,'LastName',0) then
- begin
- temp := user_first_name;
- user_first_name := copy(temp,1,pos(' ',temp)-1);
- user_last_name := copy(temp,pos(' ',temp)+1,length(temp));
- end else user_last_name := dropstring(getentryi(BBSType,'LastName',0));
- user_citystate := dropstring(getentryi(BBSType,'CityState',0));
- baud_rate := dropinteger(getentryi(BBSType,'BaudRate',0));
- user_access_level := dropinteger(getentryi(BBSType,'AccessLevel',0));
- ansic := dropboolean(getentryi(BBSType,'Ansi',0));
- bbs_time_left := dropinteger(getentryi(BBSType,'MinutesLeft',0));
- IF (lockedbaud = 0) then
- lockedbaud := dropinteger(getentryi(BBSType,'LockedBaud',0));
- if (com_port = 0) and (BBSType <> 'DOORSYS') and (BBSType <> 'DORINFO')
- then com_port := dropinteger(getentryi(BBSType,'ComPort',0))
- else if (com_port = 0) then begin
- temp := dropstring(getentryi(BBSType,'ComPort',0));
- com_port := str_to_int(copy(temp,pos('M',temp)+1,1));
- end;{else}
- if node_num = 0 then node_num := dropinteger(getentryi(BBSType,'Node',0));
- if (baud_rate = 0) or (com_port = 0) then local := true;
- if ansic = true then graphics := ANSI
- else graphics := ASCII;
- end;
-
- begin
- NonSIrq := 0;
- lockedbaud := 0;
- NonSPort := '$0000'
- end.